<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            width: 100%;
            height: 100%;
            background-color: skyblue;
        }

        div {
            width: 650px;
            margin: auto;
            margin-top: 200px;
        }

        input {
            display: block;
            width: 100px;
            height: 30px;
            padding-left: 80px;
            margin: auto;
            background-color: rgb(78, 75, 71);
            opacity: 0.5;
            border-radius: 30px;
            transition: all 1s;
        }

        input:hover {
            width: 300px;
            padding-left: 300px;
        }

        ul {
            display: block;
            list-style: none;
          margin-left: 320px;
        }

        ul>li {
            margin: auto;
        }

        img {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: skyblue;
            position: absolute;
            bottom: -31px;
            right: -56px;
            display: none;
            cursor: pointer;
        }
        div>span {
            position: relative;

        }

        ul>li {
            display: none;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div>
        <span>
            <input type="text" placeholder="搜索" >
            <img src="./imgs/搜索.png" alt="">
        </span>
        <ul>

        </ul>
    </div>
    <script src="./jquery-3.6.0.min.js"></script>
    <script>
        $('input').on('click', function () { 
            $('img').show(1000, 'linear')
            $(this).css({
                "width": "300px",
                "padding-left": "300px"
            })
        })
        $('img').on('click', function () {
                let a = $('input').val()
                $('<li>').html(a).appendTo('ul')
                $('ul>li').show(1000, 'linear')
         })
         $('ul').on('click','li',function(e){
           $(e.target).remove()
         })
    </script>
</body>

</html>